export default {
  namespaced: true,
  state: {
    isShowToast: false,
    toastMsg: "",
    toastType: "",
  },
  getters: {},
  mutations: {
    chanIsShowToast(state, payload) {
      state.isShowToast = payload.isShowToast;
      if (payload.isShowToast) {
        state.toastMsg = payload.toastMsg
        state.toastType = payload.toastType
      }
    }
  },
  actions: {
    asyncIsShowToast({commit},payload){
      commit("chanIsShowToast",{
        isShowToast:payload.isShowToast,
        toastMsg:payload.toastMsg,
        toastType:payload.toastType,
      })
      setTimeout(()=>{
        commit("chanIsShowToast",{
          isShowToast:false,
        })
      },1500)
    }
  },
}

// 面试题   你又没有封装过什么组件，怎么封装的
// 1.
